package com.ludum.game.map;


import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.ludum.game.collision.CollisionManager;
import com.ludum.game.collision.RectangleShape;
import com.ludum.game.rendering.Drawable;
import com.ludum.game.rendering.TextureManager;

public class Block implements Drawable{
	
	Vector2 pos;
	Vector2 size;
	RectangleShape shape;

	BlockType type;

	public Block(Vector2 pos, Vector2 size, BlockType type){
		this.pos = pos;
		this.size = size;
		this.type = type;
		CollisionManager collisionManager = CollisionManager.getInstance();
		shape = collisionManager.newRectangleShape(pos, size);
	}
	
	public void draw(SpriteBatch batch){				
		batch.draw(TextureManager.getInstance().blockTexture(0),
				getx(),
				gety(),
				size.x,
				size.y);
		
	} 
	
	
	//////// GETTERS ////////
	
	public float getx(){
		return pos.x;
	}

	public float gety(){
		return pos.y;
	}
	
	public float getw(){
		return size.x;
	}
	
	public float geth(){
		return size.y;
	}
}
